feat(builder): add pre-seal validation hooks and schema compliance checks#185
Merged
feat(builder): add pre-seal validation hooks and schema compliance checks#185
Conversation
…ecks Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_validate()inFd5Builderwith JSON schema compliance checking, description quality warnings (non-blocking), and product-specific validation via duck-typedvalidate()methodpre_seal_hooksparameter tocreate()for user-defined validation/inspection hooks called before sealingcheck_descriptions_file()toquality.pyfor checking description quality on open HDF5 files_walk()inquality.pyresilient to external links that cannot be resolvedTest plan
test_schema_validation_catches_missing_dataset-- schema requires 'values' group, not written, seal raisesFd5ValidationErrortest_schema_validation_passes_valid_file-- normal create + seal workstest_description_quality_warns_short-- short description triggersUserWarningtest_description_quality_does_not_block-- short description still seals successfullytest_product_validate_method_called-- schema with customvalidate()is called during sealtest_product_validate_can_reject-- schemavalidate()raises, seal abortstest_pre_seal_hooks_called-- hook called with openh5py.Filetest_pre_seal_hook_can_abort-- hook raises, seal aborts, temp file cleaned uptest_no_hooks_default-- default behavior unchangedtest_create.py+test_preseal_validation.pypassmip_coronalfailures excluded)🤖 Generated with Claude Code